//---------------------------
// Includes
//---------------------------
#include "LevelElement.h"

//---------------------------
// Constructor & Destructor
//---------------------------
LevelElement::LevelElement()
:m_pLevel(0)
,m_bCastShadow(false)
,mfxBuildShadowMapLightWVPVar(0)
,mfxBuildShadowMapDiffuseMapVar(0)
,mBuildShadowMapTech(0)
,m_BoundingSphereRadius(0)
,m_bEnableDraw(false)
{
	ResetWorldMatrix();
}

LevelElement::~LevelElement()
{
	// nothing to destroy
}

const D3DXMATRIX& LevelElement::GetWorldMatrix() const
{
	return m_World;
}

void LevelElement::ResetWorldMatrix()
{
	D3DXMatrixIdentity(&m_World);
}

void LevelElement::SetWorldMatrix(const D3DXMATRIX& world)
{
	m_World=world;
}
void LevelElement::Translate(const D3DXVECTOR3 pos)
{
	m_Transformer.Translate(pos,m_World);
}
void LevelElement::Rotate(const D3DXVECTOR3 angles)
{
	m_Transformer.Rotate(angles, m_World);
}
void LevelElement::Scale(const D3DXVECTOR3 scales)
{
	m_Transformer.Scale(scales, m_World);
}
//void LevelElement::OnGunHit()
//{
//	//MessageBox(0,L"Hit",0,0);
//}

